import  requests
#链接 ajax 传递链接没有发生变化
url='http://www.kfc.com.cn/kfccda/ashx/GetStoreList.ashx?op=keyword'
# 传递参数
for page in range(1,10):
    data={
        'cname': '',
        'pid': '',
        'keyword': '北京',
        'pageIndex':str(page),
        'pageSize': '10',
    }
    header={
       'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
    }
    response=requests.post(url=url,data=data)
    response.encoding='utf-8'
    json=response.json()
    for dict in json['Table1']:
        title=dict['storeName']
        print(title)


